<!DOCTYPE html>
<
<html class="loading" lang="en" data-textdirection="ltr" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <title>明日校园管理平台</title>
    <link rel="stylesheet" type="text/css" href="/app-assets/css/vendors.css">
    <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_2959825_5rg9hbmib6x.css">
    <style>
        body {
            margin: 0;
        }

        header {
            margin: 30px auto;
            text-align: center;
        }

        .container {
            width: 80%;
            margin: 0 auto;
        }


        tr, td {
            border: 1px solid #ccc;
            text-align: center;
        }

        th {
            color: #fff;
            height: 40px;
        }

        td {
            font-size: 12px;
            padding: 10px
        }

        tr > th:nth-child(1) {
            background-color: #69A4E0;
            border-color: #69A4E0;
        }

        tr > th:nth-child(2) {
            background-color: #3CC051;
            border-color: #3CC051;
        }

        tr > th:nth-child(3) {
            background-color: #ED4E2A;
            border-color: #ED4E2A;
        }

        tr > th:nth-child(4) {
            background-color: #57B5E3;
            border-color: #57B5E3;
        }

        tr > th:nth-child(5) {
            background-color: #FCB322;
            border-color: #FCB322;
        }

        tr > th:nth-child(6) {
            background-color: #4ad8e4;
            border-color: #4ad8e4;
        }

        tr > th:nth-child(7) {
            background-color: #852B99;
            border-color: #852B99;
        }

        tr > th:nth-child(8) {
            background-color: #999;
            border-color: #999;
        }
    </style>
</head>
<body class="vertical-layout vertical-menu 2-columns   menu-expanded fixed-navbar" data-open="click"
      data-menu="vertical-menu" data-color="bg-gradient-x-purple-blue" data-col="2-columns">
<div th:replace="header::header"></div>
<div class="main-menu menu-fixed menu-light menu-accordion    menu-shadow " data-scroll-to-active="true"
     data-img="app-assets/images/backgrounds/02.jpg">
    <div class="navbar-header">
        <ul class="nav navbar-nav flex-row">
            <li class="nav-item mr-auto"><a class="navbar-brand" href="../index.html"><img class="brand-logo"
                                                                                           alt="Chameleon admin logo"
                                                                                           src="/app-assets/images/logo2.png"/>
                <h3 class="brand-text">明日校园管理平台</h3>
            </a></li>
            <li class="nav-item d-md-none"><a class="nav-link close-navbar"><i class="ft-x"></i></a></li>
        </ul>
    </div>
    <div th:replace="menu::menu"></div>

    <div class="navigation-background"></div>
</div>
<div class="app-content content">
    <div class="content-wrapper">
        <div class="content-wrapper-before"></div>
        <div class="content-header row">
            <div class="content-header-left col-md-4 col-12 mb-2">
                <h3 class="content-header-title">课程基本信息</h3>
            </div>
            <div class="content-header-right col-md-8 col-12">
                <div class="breadcrumbs-top float-md-right">
                    <div class="breadcrumb-wrapper mr-1">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a th:href="@{/}">主页</a></li>
                            <!--  <li class="breadcrumb-item"><a href="pwd.html"> 修改密码</a></li>-->
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-body">
            <section class="file-browser">
                <div class="row match-height">
                    <div class="col-lg-12 col-md-12">
                        <div class="card" style="">
                            <div class="card-block">
                                <div class="card-body">
                                    <!--                                    <div class="topbtn">-->
                                    <!--                                        <a class="btn btn-bg-gradient-x-purple-red" th:href="@{/courseTime/update}" >添加</a>-->
                                    <!--                                    </div>-->
                                    <div class="selbox">
                                        <div class="form1">
                                            <form th:action="@{/courseTime/select}">
                                                <div class="selbox">
                                                    <div class="form1">
                                                        <ul class="row">
                                                            <li class="col-xs-4">
                                                                <span>班级：</span>
                                                                <label>
                                                                    <select name="classCode" id="classCode" class="form-control" >

                                                                        <option value="">选择班级</option>

                                                                        <option th:each="cs : ${classesList}" th:value="${cs.classCode}" th:selected="${cs.classCode == courseTime.classCode ? true : false}">
                                                                            <span th:text="${cs.className}"></span>
                                                                        </option>
                                                                    </select>
                                                                </label>
                                                            </li>

                                                            <li class="col-xs-4" style="padding-left: 10px">
                                                                <input href="#" class="btn btn-primary" type="submit"
                                                                       value="查询"/>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </form>

                                        </div>
                                    </div>
                                    <br> <br>
                                    <br>
                                    <br>
                                    <br>
                                    <div class="container">

                                        <table cellspacing="0" align="center" width="100%" cellpadding="8px">
                                            <tbody>
                                            <tr>
                                                <th>节次(1~5)</th>
                                                <th>星期一</th>
                                                <th>星期二</th>

                                                <th>星期三</th>
                                                <th>星期四</th>
                                                <th>星期五</th>
                                                <th>星期六</th>
                                                <th>星期日</th>
                                            </tr>
                                            <!--<tr th:each="section,timeStat: ${courseTime}">
                                                <td th:text="${section.section}"></td>
                                                <td th:each="week:${courseTime}">
                                                    <span th:text="${week.courseName}"></span>
                                                </td>
                                            </tr>-->
                                            <!--
                                                嵌套循环：
                                                    外循环：即是行，也是节次
                                                    内循环：即是列，也是周
                                                    <span th:each="i:${#numbers.sequence(1, 5)}">
                                                        <span th:text="${i}"></span>
                                                    </span>
                                             -->
                                            <tr th:each="rowIndex: ${#numbers.sequence(1, 5)}">
                                                <td th:each="colIndex: ${#numbers.sequence(0, 7)}">
                                                    <!-- 显示第一列，第几节次 -->
                                                    <span th:if="${colIndex} == 0"
                                                          th:text="'第' + ${rowIndex} + '节课'"></span>
                                                    <!-- 循环课程信息，将课程信息根据节次、周进行渲染 -->
                                                    <div  th:each="course: ${courseTimeList}">
                                                        <div th:if="${rowIndex == course.section and colIndex == course.week}">
                                                            <div th:if="${course.id} > 0">
                                                                <span shiro:hasAnyRoles="manager,normal"  th:text="${course.courseName}"></span>
                                                                <a shiro:hasRole="admin" th:href="@{/courseTime/edit/{id}(id=${course.id})}">
                                                                    <span  th:text="${course.courseName}"></span>
                                                                </a>
                                                                <a shiro:hasRole="admin" th:href="@{/courseTime/delete/{id}(id=${course.id})}">
                                                                    <i class="iconfont icon-shanchu"></i>
                                                                </a>
                                                            </div>
                                                            <div th:if="${course.id} <= 0">
                                                                <a shiro:hasRole="admin" th:href="@{/courseTime/addCourseTime/{classCode}/{section}/{week}(classCode=${course.classCode},week=${colIndex},section=${rowIndex})}">
                                                                    <i class="iconfont icon-zengjia"></i>
                                                                </a>
                                                            </div>
                                                        </div>

<!--                                                        th:href="@{/courseTime/update/{section}{week}(section=${rowIndex},week=${colIndex})}"-->
                                                        <!-- <a th:href="@{/courseTime/update}"
                                                            th:if="${course.section==null and course.week==null }"><i
                                                                 class="iconfont icon-zengjia"></i></a>-->
                                                    </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <br> <br>
                                    <br>
                                    <br>
                                    <br>


                                    <!--                                    <td><a style="color: #0e459e" th:href="@{/courseTime/edit/{id}(id=${courseTime.id})}">编辑</a>-->
                                    <!--                                        <a style="color: #992900" th:href="@{/courseTime/delete/{id}(id=${courseTime.id})}">删除</a>-->
                                    <!--                                    </td>-->


                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>
</div>
<footer class="footer footer-static footer-light navbar-border navbar-shadow">
    <div class="clearfix blue-grey lighten-2 text-sm-center mb-0 px-2"><span
            class="float-md-left d-block d-md-inline-block">2021 &copy;TomorrowSchoolMs 明日校园智慧管理系统 © 2021-2024</span>
        <ul class="list-inline float-md-right d-block d-md-inline-blockd-none d-lg-block mb-0">
            <li class="list-inline-item">明日校园智慧管理系统</li>
        </ul>
    </div>
</footer>
<!-- BEGIN VENDOR JS-->
<script src="/app-assets/js/vendors.min.js" type="text/javascript"></script>
<script src="/app-assets/js/app-menu.js" type="text/javascript"></script>
<script src="/app-assets/js/app.js" type="text/javascript"></script>
<script src="/app-assets/laydate/laydate.js" type="text/javascript"></script>

<script>
    lay('#version').html('-v' + laydate.v);
    laydate.render({
        elem: '#date'
        , range: true
        , theme: '#6967ce'
    });
</script>
</body>

</html>